using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public static class ParseUtil
{ 
    public static object Parse(Type type, string str)
    {
        if(type == typeof(int))
        {
            return int.Parse(str);
        }
        else if(type == typeof(string))
        {
            return str;
        }
        else if(type == typeof(long))
        {
            return long.Parse(str);
        }
        else if(type == typeof(float))
        {
            return float.Parse(str);
        }
        else if(type == typeof(double))
        {
            return double.Parse(str);
        }
        else if(type == typeof(short))
        {
            return short.Parse(str);
        }
        else if(type == typeof(byte))
        {
            return byte.Parse(str);
        }
        else if(type == typeof(UInt32))
        {
            return UInt32.Parse(str);
        }
        else if(type == typeof(UInt64))
        {
            return UInt64.Parse(str);
        }
        throw new Exception("not implement");
    }
}
